home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3dm / audiofile / afSaveFilePosition.z / afSaveFilePosition
Encoding:
Text File  |  2002-10-03  |  3.5 KB  |  67 lines

  1.  
  2.  
  3.  
  4. aaaaffffSSSSaaaavvvveeeeFFFFiiiilllleeeePPPPoooossssiiiittttiiiioooonnnn((((3333ddddmmmm))))                                aaaaffffSSSSaaaavvvveeeeFFFFiiiilllleeeePPPPoooossssiiiittttiiiioooonnnn((((3333ddddmmmm))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      afSaveFilePosition, afRestoreFilePosition - save and retrieve logical
  10.      audio sample read pointer
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ddddmmmmeeeeddddiiiiaaaa////aaaauuuuddddiiiiooooffffiiiilllleeee....hhhh>>>>
  14.  
  15.      vvvvooooiiiidddd aaaaffffSSSSaaaavvvveeeeFFFFiiiilllleeeePPPPoooossssiiiittttiiiioooonnnn((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee))))
  16.  
  17.      vvvvooooiiiidddd aaaaffffRRRReeeessssttttoooorrrreeeeFFFFiiiilllleeeePPPPoooossssiiiittttiiiioooonnnn((((AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee ffffiiiilllleeee))))
  18.  
  19. PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRR
  20.      _f_i_l_e   is an AAAAFFFFffffiiiilllleeeehhhhaaaannnnddddlllleeee structure, previously returned by
  21.             aaaaffffOOOOppppeeeennnnFFFFiiiilllleeee(3dm) or aaaaffffOOOOppppeeeennnnFFFFDDDD(3dm).
  22.  
  23. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  24.      aaaaffffSSSSaaaavvvveeeeFFFFiiiilllleeeePPPPoooossssiiiittttiiiioooonnnn(((()))) stores the logical audio sample read pointer to
  25.      allow an application to perform UNIX operations such as rrrreeeeaaaadddd(2) or
  26.      llllsssseeeeeeeekkkk(2).  The pointer MUST then be restored via aaaaffffRRRReeeessssttttoooorrrreeeeFFFFiiiilllleeeePPPPoooossssiiiittttiiiioooonnnn
  27.      before ANY additional calls to AF routines such as aaaaffffRRRReeeeaaaaddddFFFFrrrraaaammmmeeeessss(3dm) or
  28.      aaaaffffWWWWrrrriiiitttteeeeFFFFrrrraaaammmmeeeessss(3dm).  See the _C_A_V_E_A_T_S in aaaaffffOOOOppppeeeennnnFFFFDDDD(3dm) and aaaaffffIIIInnnnttttrrrroooo(3dm).
  29.  
  30. EEEEXXXXAAAAMMMMPPPPLLLLEEEE
  31.           AFfilehandle file;
  32.           int fd, value;
  33.           file = afOpenFile("mysound", "r", NULL); /* open file */
  34.           afSaveFilePosition(file);                /* save file pointer */
  35.           fd = afGetFD(handle);                    /* get file descriptor */
  36.                                                    /* now do UNIX operations */
  37.           lseek(fd, 50, SEEK_SET);
  38.           read(fd, &value, sizeof(value));
  39.  
  40.           afRestoreFilePosition(file);             /* restore pointer */
  41.           afReadFrames(...);                       /* and go on */
  42.  
  43. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  44.      afIntro(3dm), afGetFD(3dm), afReadFrames(3dm), afWriteFrames(3dm)
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.